//
//  HXChatListViewController.m
//  NewProject
//
//  Created by Livespro on 2017/5/5.
//  Copyright © 2017年 FZ. All rights reserved.
//

#import "HXChatListViewController.h"

#import "HXSettingViewController.h"

@interface HXChatListViewController ()

@property (nonatomic, strong)  UIButton *settingBtn;

@end

@implementation HXChatListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.naviStand.rightButtons addObject:self.settingBtn];
    self.settingBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, -20);
}

#pragma mark - lazyLoad

- (UIButton *)settingBtn{
    
    if (!_settingBtn) {
        
        _settingBtn = [UIButton buttonWithCustomTypeNomalImage:@"setting" Frame:CGRectMake(0, 0, 44, 44)];
        
        __weak typeof(self) weakSelf = self;
        [[_settingBtn rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:^(__kindof UIControl * _Nullable x) {
            
            HXSettingViewController *setting = [[HXSettingViewController alloc]init];
            
            [weakSelf.navigationController pushViewController:setting animated:YES];
        }];
        
    }
    
    return _settingBtn;
}

- (void)staticViewsWithoutNib{
    
    [self addBack];
}

- (void)back{
    
    [self.tabBarController.navigationController popViewControllerAnimated:YES];
}

@end
